{include file="common/header"/}
<div class="lemo-container">
    <div class="lemo-main">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>商品{:lang('list')}</legend>

            <blockquote class="layui-elem-quote">
                <div class="layui-form layui-row layui-col-space16">
                    
                    <!-- <label class="layui-form-label">关键字</label> -->

                        
                        <div class="layui-inline">
                            <input type="text" name="keywords" id="keywords" placeholder="请输入关键字" autocomplete="off" class="layui-input">

                        </div>
                        <button class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="search" id="find">搜索</button>

                    

                        <div class="layui-col-md1 layui-inline">
                            <select  name="platform"  id="platform"  >
                                <option value="">请选择媒体</option>
                                <option value="dy_juliang">巨量</option>
                                <option value="ks_dsp">快手</option>
                                <option value="tracking_e_qq">腾讯</option>
                            </select>
                          </div>

                          <div class="layui-col-md1 layui-inline"">
                            <select  name="shop"  id="shop"  >
                                <option value="">请选择平台</option>
                                <option value="pdd">拼多多</option>
                                <option value="jd">京东</option>
                                <option value="tb">淘宝</option>
                            </select>
                          </div>
                     
<br>
                    

                </div>

            </blockquote>

        </fieldset>

        <table class="layui-table" id="list" lay-filter="list"></table>
    </div>
</div>
{include file="common/footer"/}

<script type="text/html" id="platform1">
    {{# if (d.platform == 'dy_juliang') {}}
    巨量
    {{# } else if (d.platform == 'ks_dsp') {}}
    快手
    {{# } else if (d.platform == 'tracking_e_qq') {}}
    腾讯
    {{# } else {}}
 
    {{# }}}
</script>

<script type="text/html" id="shop1">
    {{# if (d.shop == 'pdd') {}}
    拼多多
    {{# } else if (d.shop == 'jd') {}}
    京东
    {{# } else if (d.shop == 'tb') {}}
    淘宝
    {{# } else {}}
 
    {{# }}}
</script>

<script type="text/html" id="is_limit">
    {{# if (d.is_limit == 0) {}}
    未限制
    {{# } else if (d.is_limit == 2) {}}
    限制
    {{# } else {}}
    不知道
    {{# }}}
</script>
<script type="text/html" id="status">
    {{# if(d.right_auth_status==1){ }}
    <a class="layui-btn  layui-btn-xs layui-btn-disabled" >备案中</a>
    
    {{# }else{  }}
    <a  class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">已备案</a>
    {{# } }}
</script>

<script type="text/html" id="add_time">
    {{layui.util.toDateString(d.add_time*1000, 'yyyy-MM-dd HH:mm:ss')}}
</script>
<script>
    var tableIn;
    layui.config({
        base: "/static/admin/js/",
        version: true
    }).extend({
        Admin: 'Admin'
    }).use(['element', 'layer', 'Admin'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;
            table.on('toolbar(list)', function(obj){
                if(obj.event === 'page_size'){
                    table.reload('list', {
                    where: {
                        page_size: obj.config.limit // 获取当前分页容量
                    }
                    });
                }
            });
        tableIn = table.render({
            elem: '#list',
            url: '{:url("itemList")}',
            method:'post',
            title:'{:lang("admin")}{:lang("list")}',
            cols: [[
                {field:'qf_item_id', title: 'ID', width:60,fixed: true}
                ,{field:'platform', title: '媒体', width:100, templet: "#platform1"}
                ,{field:'item_name', title: '商品名称', width:480}
                ,{field:'shop', title: '平台', width:100, templet: '#shop1'}
                ,{field:'add_time', title: '创建时间', width:180, templet: "#add_time"}
                ,{field:'min_normal_price', title: '最小单买价格',width:100}
                ,{field:'min_group_price', title: '最小成团价格',width:100}
                ,{field:'mall_name', title: '店铺名称',width:150}
                ,{field:'is_limit', title: '是否限制推广',width:100, templet: '#is_limit'}
                ,{field:'right_auth_status', title: '备案状态',width:150, templet: '#status'}
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 20,
            page: true,
            request: {
                limitName: 'page_size', // 将默认的limit参数改为page_size
                pageName: 'page',
            }
        });

    });
</script>
